﻿<div class="row wrapper border-bottom white-bg page-heading"> <div class="col-lg-10"> <h2>业务模型</h2> <ol class="breadcrumb"> <li> <a href="index.html">首页</a> </li> <li> <a>业务模型</a> </li> <li class="active"> <strong>创建对象</strong> </li> </ol> </div> <div class="col-lg-2"> </div> </div>
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content form-inline">
						<button id="btnNewTable" class="btn btn-success" type="submit" onclick="btnNewTableClick()">创 建</button>
					</div>
				</div>
			</div>
		</div>

			<div class="row">
				<div class="col-lg-12">
					<div class="ibox float-e-margins">
						<div class="ibox-content">
							<!--table table-border table-bordered table-bg-->
				<table id="tbTableList" class="table table-striped table-bordered table-hover  dataTable">
					<thead>
					<tr>
						<th style="text-align:center;">编码</th>
						<th style="text-align:center;">分类</th>
						<th style="text-align:center;">钩子类型</th>
						<th style="text-align:center;">所属流程</th>
						<th style="text-align:center;">描述</th>
						<th style="text-align:center;">操作</th>
					</tr>
					</thead>
				</table>
						</div>
				</div>
			</div>
			</div>
	</div>

<div>
<!-- 模态框（表单） -->
<div class="modal fade" id="newTableDlg">
	<div class="modal-dialog" style="width:860px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
				<h4 class="modal-title">新增钩子</h4>
			</div>
			<div class="modal-body">
				<div class="row form-horizontal form-group">
					<label class="col-sm-1 control-label">分类</label><div class="col-sm-2"><select id="bizType" class="form-control"><option value="办公类">办公类</option><option value="报销类">报销类</option><option value="考勤类">考勤类</option></select></div>
					<label class="col-sm-1 control-label">类型</label><div class="col-sm-2"><select id="hookType" onchange="hookTypeChanged(this)" class="form-control"><option value="before_url">前置接口</option><option value="after_url">后置接口</option><option value="before_script">前置脚本</option><option value="after_script">后置脚本</option></select></div>
					<label class="col-sm-1 control-label">编码</label><div class="col-sm-2"><input id="hookCode" autocomplete="off" placeholder="英文字符流程内唯一" type="text" class="form-control" /></div>
					<label class="col-sm-1 control-label">流程</label><div class="col-sm-2"><input id="processName" autocomplete="off" placeholder="输入流程编码" data-provider="typeahead" type="text" dataitem="12" class="form-control" autocomplete="off"  /></div>
				</div>
				<div class="row form-horizontal form-group">
					<label class="col-sm-1 control-label">描述</label><div class="col-sm-11"><input id="remark" autocomplete="off" placeholder="输入钩子描述" type="text" class="form-control" /></div>
				</div>
				<div class="alert alert-warning">
					<span style="font-weight:700;line-height:18px;color:#E6A23C">钩子参数：</span>
					<p style="margin:5px 0 0;color:#E6A23C"><b>前置：</b>{"flow_id":""}</p>
					<p style="margin:5px 0 0;color:#E6A23C">文本-不超过250字符数量；浮点数-不超过2位小数</p>
				</div>
				<div class="row form-horizontal form-group">
					<div class="col-sm-12"><input id="hookUrl" placeholder="输入地址" type="text" class="form-control" /></div>
				</div>
				<div class="row form-horizontal form-group">
					<div class="col-sm-12"><textarea style="display:none" id="scriptCode" class="form-control"></textarea></div>
				</div>
				<div class="row form-horizontal form-group"><div class="col-sm-12">
					<div class="input-group2 date">
						<input id="txbScriptText" type="text" class="form-control" /><span class="input-group-addon" title="点击测试" onclick="runTest()"><i class="fa fa-bug"></i></span>
					</div></div>
				</div>
				<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关 闭</button>
				<button type="button" id="dlgModelSave" style="display:none" onclick="saveTableHook()" class="btn btn-primary">保 存</button>
				<button type="button" id="dlgModelUpdate" style="display:none" onclick="saveEditHook()" class="btn btn-primary">修 改</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</div>

<div>
	<!-- 模态框（表单） -->
	<div class="modal right fade" id="editTableDlg">
		<div class="modal-dialog" style="width:620px">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<h4 class="modal-title">新增字典</h4>
				</div>
				<div class="modal-body">
					<div class="row form-horizontal">
						<div class="form-group">
							<label class="col-sm-2 control-label">编码</label>
							<div class="col-sm-10"><input id="editCode" type="text" class="form-control" disabled/></div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">父编码</label>
							<div class="col-sm-10"><input id="editParentCode" type="text" class="form-control" disabled/></div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">内容</label>
							<div class="col-sm-10"><textarea rows="3" id="editText" class="form-control" /></div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">排序</label>
							<div class="col-sm-3"><input id="editSort" type="text" class="form-control spin"/></div>
							<div class="col-sm-7"></div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分类</label>
							<div class="col-sm-10">
								<input id="editCategory" type="text" class="form-control" disabled/></div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">描述</label>
							<div class="col-sm-10"><input id="editRemark" type="text" class="form-control" /></div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button class="btn btn-primary" onclick="saveEditDict()"> 修 改 </button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</div>

	<script id="ModleRow_Tpl" type="text/html">
		{{# for(var i=0; i<d.length; i++){ }}
		<tr>
			<td><input type="text" name="fieldName" value="{{d[i].fieldName}}" class="form-control" placeholder="英文名"/></td>
			<td><input type="text" name="memo" value="{{d[i].memo}}" class="form-control" placeholder="中文描述"/></td>
			<td><select onchange="dataTypeChanged(this)" name="dataType" class="form-control" {{# if (["order_no","emp_id","dept_code"].indexOf(d[i].fieldName)>=0) { }}disabled{{# } }}><option value="nvarchar" {{# if (d[i].dataType=="nvarchar") { }} selected {{# } }}>文本</option><option value="int" {{# if (d[i].dataType=="int") { }} selected {{# } }}>整型</option><option value="decimal" {{# if (d[i].dataType=="decimal") { }} selected {{# } }}>浮点型</option><option value="cascader" {{# if (d[i].dataType=="cascader") { }} selected {{# } }}>级联编码</option><option value="select" {{# if (d[i].dataType=="select") { }} selected {{# } }}>下拉编码</option><option value="depttree" {{# if (d[i].dataType=="depttree") { }} selected {{# } }}>下拉部门</option></select></td>
			<td><div class="checkbox checkbox-success"><input name="allowNull" type="checkbox" onclick="allowNullCheck(this)" class="ic form-control styled" {{# if (!d[i].allowNull) { }} checked {{# } }}/><label></label></div></td>
			<td><input type="text" name="dataConfig" value="{{d[i].dataConfig}}" disabled="disabled" class="form-control" placeholder="数据源地址"/></td>
			<td>{{# if (["order_no","emp_id","dept_code"].indexOf(d[i].fieldName)<0) { }}
				<button class="btn btn-danger btn-circle" type="button" onclick="deleteData(this,'{{i}}')"><i class="fa fa-trash"></i></button>
				{{# } }}
			</td>
		</tr>
		{{# } }}
	</script>

<link href="lib/datatables/1.10.4/dataTables.bootstrap.css" rel="stylesheet">
<script src="lib/datatables/1.10.4/jquery.dataTables.js"></script>
<script src="lib/datatables/1.10.4/dataTables.bootstrap.js"></script>
<!--要在最下面设置全局参数-->
<script src="lib/datatables/1.10.4/dataTables.extend.js"></script>
<script src="lib/typeahead/bootstrap3-typeahead.min.js"></script>
<link rel="stylesheet" href="lib/bootstrap-select/1.13.14/bootstrap-select.min.css">
<script src="lib/bootstrap-select/1.13.14/bootstrap-select.min.js"></script>
<script type="text/javascript">


</script>
	<style>
		.form-box{
			margin-top:20px;border-style:solid solid none;
			border-width:1px 0px;color:inherit;border-color:#e7eaec;border-image:none;
			padding:15px 20px 20px 20px
		}
		.flow-info-box {
			display: flex;
			flex-wrap: wrap;
			border-bottom: 1px solid rgba(43,52,65,.05);
			margin-bottom: 20px;
			/*padding-left: 20px;*/
			/*padding-top: 15px;*/
			padding-bottom: 15px;

		}
		.box-icon{
			border-radius: 50%;
			position: relative;
			z-index: 1;
			display: inline-flex;
			justify-content: center;
			align-items: center;
			width: 34px;
			height: 34px;
			font-size: 16px;
			box-sizing: border-box;
			transition: .15s ease-out;
			color: rgba(43, 52, 66, 0.6);
			background-color: rgba(43, 52, 66, 0.1);
			margin-top: 5px;
		}
		.flow-info-body{
			margin-left: 20px; margin-right: 20px;
		}
		.box-desc{
			margin-left: 10px;
		}
		.box-name{
			margin-top: 0px;
			margin-bottom: 5px;
			font-size: 14px;
		}
		.box-code{
			margin-top: 0px;
			color: rgba(43,52,65,.4);
			font-size: 70%;
		}
	</style>
<style>
	.modal.left .modal-dialog,.modal.right .modal-dialog{position:fixed;margin:auto;height:100%;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}
	.modal.left .modal-content,.modal.right .modal-content{height:100%;overflow-y:auto}
	.modal.left .modal-body,.modal.right .modal-body{padding:15px 15px 80px}
	.modal.left.fade .modal-dialog{left:-320px;-webkit-transition:opacity .3s linear,left .3s ease-out;-moz-transition:opacity .3s linear,left .3s ease-out;-o-transition:opacity .3s linear,left .3s ease-out;transition:opacity .3s linear,left .3s ease-out}
	.modal.left.fade.in .modal-dialog{left:0}
	.modal.right.fade .modal-dialog{right:-320px;-webkit-transition:opacity .3s linear,right .3s ease-out;-moz-transition:opacity .3s linear,right .3s ease-out;-o-transition:opacity .3s linear,right .3s ease-out;transition:opacity .3s linear,right .3s ease-out}
	.modal.right.fade.in .modal-dialog{right:0}
	.modal-content{border-radius:0;border:none}
	.modal-header{border-bottom-color:#eee;background-color:#fafafa}
</style>
	<style>
		.input-group2[class*=col-] {
			float: none;
			/*padding-right: 0;*/
			/*padding-left: 0;*/
		}
		.input-group2 {
			position: relative;
			display: table;
			border-collapse: separate;
		}
	</style>
	<link rel="stylesheet" href="lib/codemirror/lib/codemirror.css">
	<link rel="stylesheet" href="lib/codemirror/theme/monokai.css">
	<script src="lib/codemirror/lib/codemirror.js"></script>
	<script src="lib/codemirror/addon/hint/show-hint.js"></script>
	<link rel="stylesheet" href="lib/codemirror/addon/hint/show-hint.css?v=0.3">
	<script src="lib/codemirror/addon/edit/matchbrackets.js"></script>
	<script src="lib/codemirror/mode/vivid/vivid.js"></script>
	<script src="lib/codeeditor.js"></script>
	<script src="lib/typeahead/bootstrap3-typeahead.min.js"></script>